package cn.bnjy.controller;


import cn.bnjy.core.Result;
import cn.bnjy.service.IMenuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author chavin
 * @since 2018-11-03
 */
@RestController
@RequestMapping("/menu/")
@Slf4j
public class MenuController {

    @Autowired
    private IMenuService menuService;

    @RequestMapping("refresh")
    public Result refreshMenu() {
        if (menuService.refreshMenu()) {
            log.info("刷新菜单成功");
            return Result.success("刷新成功");
        } else {
            log.error("刷新菜单失败");
            return Result.error("刷新失败");
        }
    }

}
